package com.example.springfeature.dateconstruct;

/**
 * 电脑的java对象类
 * 实现了comparable接口是用来在二叉树中能进行有效排序
 * Created by Administrator on 2019/3/10.
 */
public class Computer implements Comparable {
    private Integer seriazeNumber;
    private String brandName;
    @Override
    public int compareTo(Object o) {
        Computer annother = (Computer)o;
        return seriazeNumber - annother.getSeriazeNumber();
    }

    public Computer() {
        super();
    }

    public Computer(Integer seriazeNumber, String brandName) {
        this.seriazeNumber = seriazeNumber;
        this.brandName = brandName;
    }

    public Integer getSeriazeNumber() {
        return seriazeNumber;
    }

    public void setSeriazeNumber(Integer seriazeNumber) {
        this.seriazeNumber = seriazeNumber;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    @Override
    public String toString() {
        return seriazeNumber + "";
    }
}
